﻿namespace MSRI.HelperClasses
{
    using System;

    [Serializable]
    public class CommandClass
    {
        private string _Name;
        private CommandTypeEnum _Type;
        private string _Value;

        public CommandClass()
        {
            this._Name = "";
            this._Value = "";
            this._Type = CommandTypeEnum.SetValue;
        }

        public CommandClass(string[] Fields)
        {
            this._Name = Fields[1];
            this._Value = Fields[2];
            this._Type = (CommandTypeEnum) Convert.ToInt16(Fields[3]);
        }

        public override string ToString()
        {
            object[] objArray = new object[] { 1.ToString(), Convert.ToChar(Delim.Field), this._Name.ToString(), Convert.ToChar(Delim.Field), this._Value.ToString(), Convert.ToChar(Delim.Field), ((int) this._Type).ToString() };
            return string.Concat(objArray);
        }

        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this._Name = value;
            }
        }

        public CommandTypeEnum Type
        {
            get
            {
                return this._Type;
            }
            set
            {
                this._Type = value;
            }
        }

        public string Value
        {
            get
            {
                return this._Value;
            }
            set
            {
                this._Value = value;
            }
        }
    }
}

